package ext

import org.json.JSONArray
import java.text.SimpleDateFormat
import java.util.*


fun ArrayList<String>.toJsonArray(): JSONArray {
    val arr = JSONArray()
    this.forEach {
        arr.put(it)
    }
    return arr
}

fun currentDateStr(): String {
    val calendar = Calendar.getInstance()
    val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
    return format.format(calendar.time)
}

fun currentTimestamp(): Long {
    return System.currentTimeMillis()
}



